package com.example.medicalzb.domain;

import com.example.medicalzb.domain.superdomain.SuperDomain;
import lombok.Data;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Date;


/**
 * 医师实体类
 */
@Data
@ToString
public class Doctor extends SuperDomain {
    private Long id;

    @NotBlank(message = "姓名不能为空")
    @Pattern(regexp = "(^[\u2E80-\u9FFF]{2,4})", message = "姓名只能为汉字,且长度为2-4个汉字")
    private String name;

    @Range(min = 1, max = 130, message = "年龄格式错误")
    @NotNull(message = "年龄不能为空")
    private Integer age;

    @Range(min = 1, max = 2, message = "请输入1(男)或者2(女)")
    @NotNull(message = "性别不能为空")
    private Integer sex;//1.男 2.女

    @NotNull(message = "医师等级不能为空")
    private Integer levelId;

    @NotBlank(message = "手机号不能为空")
    @Length(min = 11, max = 11, message = "手机号格式有误")
    private String phoneNumber;

    @NotNull(message = "诊治类别不能为空")
    private String typeId;

    private Date createTime;
    private Date updateTime;
    private Long accountId;
}
